﻿@{
    ViewBag.Title = "电话录音";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<script src="~/Content/layer-v3.1.1/layer/layer.js"></script>
<script type="text/javascript">
    var subLayer;

    //页面初始化
    window.onload = function () {
        //$(window).on("resize", function () {
        //    location.reload();
        //});

        pageInt();

        //监听返回按钮的点击事件
        $("#Button_Back").on("click", function () {
            parent.closePage();
        });
        @*$("#Button_DownLoad").on("click", function () {
            window.location = '@Url.Content("~/COMM/Booking/Download")';
        });*@
    }

    //2019-03-28 录音名设置及设置录音文件路径
    function pageInt() {
        var recordCode = '@ViewBag.RecordNumber';
        var buildTime = '@ViewBag.BuildTime';
        //console.log(recordCode, buildTime);
        $("#Label_MadiaTitle").html(recordCode);
        //获取录音文件路径
        $.ajax({
            url: '@Url.Content("~/DD/AcceptEvent/VideoDownLoad")',
            data: {
                RecordNumber: recordCode,
                CallTime: buildTime
            },
            success: function (data) {  //动态设置录音文件的路径
                //$("#pid").val(data)
                //console.log(data);
                //2019-04-02 plq 动态设置录音文件地址
                //因为动态改变Object的录音文件路径不会再重新加载录音文件，故只能动态插入整个HTML
                var objectHtmlStr = '<object id="MediaPlayer1" classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" style="width:100%;height:68px;">'
                                                + '<param name="AutoStart" value="-1">'
                                                + ' <param name="Balance" value="0">'
                                                + ' <param name="enabled" value="1">'
                                                + ' <param name="EnableContextMenu" value="-1">'
                                                + ' <param name="url" value="' + data + '" id="mediaPlayerURL">'
                                                + ' <param name="PlayCount" value="1">'
                                                + '<param name="rate" value="1">'
                                                + '<param name="currentPosition" value="0">'
                                                + '<param name="currentMarker" value="0">'
                                                + '<param name="defaultFrame" value="">'
                                                + '<param name="invokeURLs" value="0">'
                                                + '<param name="baseURL" value="">'
                                                + '<param name="stretchToFit" value="0">'
                                                + '<param name="volume" value="50">'
                                                + '<param name="mute" value="0">'
                                                + '<param name="uiMode" value="mini">'
                                                + '<param name="windowlessVideo" value="0">'
                                                + '<param name="fullScreen" value="0">'
                                                + '<param name="enableErrorDialogs" value="-1">'
                                                + '<param name="SAMIStyle" value>'
                                                + '<param name="SAMILang" value>'
                                                + '<param name="SAMIFilename" value>'
                                                + '</object>';
                var obj = $(objectHtmlStr);//动态创建录音对象
                $("#recordMediaPlayerBox").empty().append(obj);//插入到DOM
                //$("#mediaPlayerURL").attr("value", data);//动态赋予Windows MediaPlayer播放器的播放文件地址
                //$("#MediaPlayer1").object.setSource(data);
            }
        });

    }


    //2019-02-14 plq function: 将Date对象获取的时间格式化为easyUI可解析的时间格式---不带时分秒
    function dateFormat(time) {
        var YY = time.getFullYear();
        var MM = (time.getMonth() + 1) < 10 ? ("0" + (time.getMonth() + 1)) : (time.getMonth() + 1);
        var DD = time.getDate() < 10 ? ("0" + time.getDate()) : time.getDate();
        //var hh = time.getHours() < 10 ? ("0" + time.getHours()) : time.getHours();
        //var mm = time.getMinutes() < 10 ? ("0" + time.getMinutes()) : time.getMinutes();
        //var ss = time.getSeconds() < 10 ? ("0" + time.getSeconds()) : time.getSeconds();
        return YY + "-" + MM + "-" + DD;
    }
    //2019-03-05 plq function: 将Date对象获取的时间格式化为easyUI可解析的时间格式---带时分秒
    function dateFormat2(time) {
        var YY = time.getFullYear();
        var MM = (time.getMonth() + 1) < 10 ? ("0" + (time.getMonth() + 1)) : (time.getMonth() + 1);
        var DD = time.getDate() < 10 ? ("0" + time.getDate()) : time.getDate();
        var hh = time.getHours() < 10 ? ("0" + time.getHours()) : time.getHours();
        var mm = time.getMinutes() < 10 ? ("0" + time.getMinutes()) : time.getMinutes();
        var ss = time.getSeconds() < 10 ? ("0" + time.getSeconds()) : time.getSeconds();
        return YY + "-" + MM + "-" + DD + " " + hh + ":" + mm + ":" + ss;
    }

    //2019-02-14 plq function: 将后台返回的时间戳字符串（“/Date(1547082632000)/”）格式化为easyUI可解析的时间格式
    function dateToTime(data) {
        if (data) {
            var endIndex = data.indexOf(')');
            var msec = parseInt(data.substring(6, endIndex));
            //console.log(msec);
            var time = new Date(msec);
            return dateFormat(time);
        }
    }
    //2019-03-05 plq function: 将后台返回的时间戳字符串（“/Date(1547082632000)/”）格式化为easyUI可解析的时间格式--带时分秒
    function dateToTime2(data) {
        if (data) {
            var endIndex = data.indexOf(')');
            var msec = parseInt(data.substring(6, endIndex));
            //console.log(msec);
            var time = new Date(msec);
            return dateFormat2(time);
        }
    }


</script>

<div style="height:100%; width:100%">
    <input id="pid" name="pid" type="hidden">
    <table style="height:100%;  width:100%">
        <tr>
            <td style="width:100%">
                <table style="width:100%">
                    <!--标题-->
                    <tr>
                        <td align="left" valign="middle">
                            <img align="bottom" src="~/Images/main/icon002a1.gif" width="20" height="20" style="vertical-align: middle;" />
                            电话录音：<span id="Label_MadiaTitle"></span>
                        </td>
                        <td align="right" valign="middle">
                            @* <a href="javascript:void(0)" id="btnAdd" class="easyui-linkbutton" style="width:50px;height: 21px; color: #09D">新增</a>*@
                        </td>
                    </tr>
                    <!--信息项-->
                    <tr>
                        <td style="padding: 0 8px 4px;" align="center">
                            <table style="font: 12pt; width: 100%;">
                                <tbody>
                                    <tr>
                                        <td style="height: 68px" id="recordMediaPlayerBox">
                                            <!--录音播放-->
                                            <!--2019-04-02 plq 动态插入-->
                                            <!--方式：调用Window MediaPlayer 9.0版本以上 组件播放录音-->
                                            @*<object id="MediaPlayer1" classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" style="width:100%;height:68px;">
                                                    <param name="AutoStart" value="-1">
                                                    <!--是否自动播放-->
                                                    <param name="Balance" value="0">
                                                    <!--调整左右声道平衡,同上面旧播放器代码-->
                                                    <param name="enabled" value="-1">
                                                    <!--播放器是否可人为控制-->
                                                    <param name="EnableContextMenu" value="-1">
                                                    <!--是否启用上下文菜单-->
                                                    <param name="url" value='@Url.Content("~/Content/image/icon/01.wav")' id="mediaPlayerURL">
                                                    <!--播放的文件地址-->
                                                    <param name="PlayCount" value="1">
                                                    <!--播放次数控制,为整数-->
                                                    <param name="rate" value="1">
                                                    <!--播放速率控制,1为正常,允许小数,1.0-2.0-->
                                                    <param name="currentPosition" value="0">
                                                    <!--控件设置:当前位置-->
                                                    <param name="currentMarker" value="0">
                                                    <!--控件设置:当前标记-->
                                                    <param name="defaultFrame" value="">
                                                    <!--显示默认框架-->
                                                    <param name="invokeURLs" value="0">
                                                    <!--脚本命令设置:是否调用URL-->
                                                    <param name="baseURL" value="">
                                                    <!--脚本命令设置:被调用的URL-->
                                                    <param name="stretchToFit" value="0">
                                                    <!--是否按比例伸展-->
                                                    <param name="volume" value="50">
                                                    <!--默认声音大小0%-100%,50则为50%-->
                                                    <param name="mute" value="0">
                                                    <!--是否静音-->
                                                    <param name="uiMode" value="mini">
                                                    <!--播放器显示模式:Full显示全部;mini最简化;None不显示播放控制,只显示视频窗口;invisible全部不显示-->
                                                    <param name="windowlessVideo" value="0">
                                                    <!--如果是0可以允许全屏,否则只能在窗口中查看-->
                                                    <param name="fullScreen" value="0">
                                                    <!--开始播放是否自动全屏-->
                                                    <param name="enableErrorDialogs" value="-1">
                                                    <!--是否启用错误提示报告-->
                                                    <param name="SAMIStyle" value>
                                                    <!--SAMI样式-->
                                                    <param name="SAMILang" value>
                                                    <!--SAMI语言-->
                                                    <param name="SAMIFilename" value>
                                                    <!--字幕ID-->
                                                </object>*@
                                        </td>
                                    </tr>
                                    <tr>
                                        <td align="right" valign="middle">
                                            <a href="javascript:;" class="easyui-linkbutton" id="Button_Back" style="">返回</a>
                                            @*<a href="javascript:;" class="easyui-linkbutton" id="Button_DownLoad" style="">下载</a>*@
                                        </td>
                                    </tr>
                                </tbody>
                            </table>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
</div>

<style>
    body {
        font-size: 13px;
    }

    h4 {
        margin: 0;
    }

    .tableInfo td {
        height: 25px;
    }

    .TableInfoTH {
        background: url('@Url.Content("~/Images/main/thbg.gif")') #FFFFFF repeat-x left top;
        height: 25px;
    }

    .TableInfoTD {
        background-color: #F0F0F0;
    }

    .l-btn-text {
        font-size: 14px;
        color: #09D;
    }
</style>
